@(query: String, plate: String, list: List[IndexedDocument], page: Int, total: Int)(implicit request: RequestHeader)

@main("欢迎来到社区！") {
<div class="main layui-clear">
  <div class="wrap">
    <div class="content" style="margin-right:0">
      <div class="fly-tab">
        <div class="layui-tab layui-tab-brief">
          <ul class="layui-tab-title">
            <li> <a href="javascript:void(0);" class="layui-this">搜索结果 (@total)</a> </li>
          </ul>
        </div>
        <i class="layui-icon fly-search">&#xe615;</i>
      </div>

      <ul class="fly-panel fly-list">
        @for(a <- list){
        <li class="fly-list-li">
          <a href="/user/home?uid=@{a.authorId}" class="fly-list-avatar">
            <img src="@a.authorHeadImg" alt="">
          </a>
          <h2 class="fly-tip">
            <a href="/@{a.plate}/view?_id=@a.id">@a.title</a>
          </h2>
          <p>
            <span><a href="/user/home?uid=@{a.authorId}">@a.author</a></span>
            <span>@utils.DateTimeUtil.toPrettyString(a.createTime)</span>
            <span>@utils.AppUtil.prettyResource(a.plate)</span>
            <span class="fly-list-hint">
              <i class="iconfont" title="回答">&#xe60c;</i> @a.replyCount
              <i class="iconfont" title="人气">&#xe60b;</i> @a.viewCount
            </span>
          </p>
        </li>
        }
      </ul>

      @if(list.isEmpty){
      <div class="fly-none">并无相关数据</div>
      }

      <div style="text-align: center">
        <div class="laypage-main">
          <a href="/search?q=@{query}&page=@{page-1}" class="laypage-prev">上一页</a><span>@{if(list.isEmpty){0}else{page}}/@{math.ceil(total/15.0).toInt}</span><a href="/search?q=@{query}&page=@{page+1}" class="laypage-next">下一页</a></div>
      </div>

    </div>
  </div>
</div>
}

<script>
</script>
